package com.dm.webCrawler.project.mapper;

import com.dm.webCrawler.framework.mybatis.BaseMapper;
import com.dm.webCrawler.project.domain.CrawlerIndex;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 记录表mapper
 */
@Mapper
public interface CrawlerIndexMapper extends BaseMapper<CrawlerIndex> {
    @Select("select count(1) from crawler_index where id=#{id} and type=#{type}")
    public int hasIndex(@Param("id") String id, @Param("type")String type);
    @Insert("insert into crawler_index(id,type) values (#{id},#{type})")
    public int appendIndex(@Param("id") String id, @Param("type")String type);
}